/*export default createConfig({
    input: 'ts/index.ts',
    pkg: pkg,
    external: [/^@tauri-apps\/api/]
})*/

import { defineConfig } from 'rollup'
import { builtinModules } from 'module'
import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import pkg from './package.json' assert { type: 'json' }

export default defineConfig([{
    input: 'ts/index.ts',
    external: []
        .concat(Object.keys(pkg.dependencies || {}))
        .concat(Object.keys(pkg.devDependencies || {}))
        .concat(builtinModules)
        .concat([/^@tauri-apps\/api/]),
    strictDeprecations: true,
    plugins: [resolve(), typescript()],
    output: [
        {
            file: pkg.main,
            format: 'cjs',
            sourcemap: true
        },
        {
            file: pkg.module,
            format: 'esm',
            sourcemap: true
        }
    ]
}])